/*
 * display.c
 *
 *  Created on: Mar 10, 2013
 *      Author: is4@uw.edu
 */

#include "display.h"

WINDOW *debugger_outer_window;
WINDOW *debugger_window;
WINDOW *console_outer_window;
WINDOW *console_window;

void display_init(void)
{
	initscr();
	cbreak();
	noecho();
	keypad(stdscr, TRUE);

	refresh();

	debugger_outer_window = newwin(LINES - 5, COLS, 0, 0);
	box(debugger_outer_window, 0, 0);
	wrefresh(debugger_outer_window);

	debugger_window = newwin(LINES - 7, COLS - 2, 1, 1);
	wrefresh(debugger_window);

	console_outer_window = newwin(5, COLS, LINES - 5, 0);
	box(console_outer_window, 0, 0);
	wrefresh(console_outer_window);

	console_window = newwin(3, COLS - 2, LINES - 4, 1);
	scrollok(console_window, TRUE);
	wrefresh(console_window);
}

void display_free(void)
{
	endwin();
}

WINDOW *display_get_console(void)
{
	return console_window;
}

WINDOW *display_get_debugger(void)
{
	return debugger_window;
}
